#!/usr/bin/env node

//console.log(process.argv[2],process.argv[3]);

const log = console.log;

const exp  = process.argv[2];

if(typeof(exp) === 'undefined' || exp === '--help' || exp === '-h'){
  help();
} else{
  calc();
}

function help(){
  log('help');
}

function calc(){
    try{
          log(`${exp}=${eval(exp)}`);
    }catch(e){
        console.error(`${exp}不是合法数学表达式`);
    }
  
}


